package com.steven.design.XingWei_Pattern.Observer;

import java.util.Observable;
import java.util.Observer;

public class Police implements Observer {

    private String name;
    public Police(String name) {
        this.name=name;
    }

    @Override
    public void update(Observable observable, Object arg) {
        if( observable instanceof Thief){
            Thief thief = (Thief) observable;
            System.out.println(this.name+"警方收到线报：嫌疑人"+thief.name+"正在"+arg.toString());
        }
    }
}
